#!/bin/bash

# 打印脚本命令.
set -x
# 在有错误输出时停止运行.
set -e

#info
clear
ONOS_HOME=~/onos
echo "...run onos NDN..."

#NDN-app-compile

echo "compile NDN apps..."

# cd $ONOS_HOME/apps/NDNandSINETandGEO/pipeconf/src/main/resources/
# make

# cd $ONOS_HOME/apps/NDNandSINETandGEO/pipeconf/
# bazel build //apps/NDNandSINETandGEO/pipeconf:all

# cd $ONOS_HOME/apps/NDNandSINETandGEO/NDN/
# bazel build //apps/NDNandSINETandGEO/NDN:all
cd /home/ylmsi3/JavaCode/onos/apps/ndn-pipeconf/src/main/resources
make

cd /home/ylmsi3/JavaCode/onos/apps/ndn-pipeconf
mvn clean install

cd /home/ylmsi3/JavaCode/onos/apps/ndn-app
mvn clean install

# cd $ONOS_HOME/apps/pinet-network-manage
# mvn install

# cd $ONOS_HOME/apps/IPv4APP
# mvn install

#new terminal for app install

cd $ONOS_HOME/
gnome-terminal --window -x bash -c "bash $ONOS_HOME/script/run-app-mvn.sh"

#onos-start

echo "starting onos..."
cd $ONOS_HOME
bazel run onos-local clean


